#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
    string removeStars(string s) {
        string ret="";
        for(char ch:s)
        {
            if(ch=='*'&&!ret.empty()) ret.pop_back();
            if(ch!='*') ret.push_back(ch);
        }
        return ret;
    }
};